import { BTBuilder } from "../../../lib/kgame/bt/BTBuilder";
import { BehaviorTree } from "../../../lib/kgame/bt/BehaviorTree";

export abstract class BaseAI {

    protected _bt: BehaviorTree;

    constructor() {
        const builder = new BTBuilder();
        this.onBuild(builder);
        this._bt = new BehaviorTree(builder.build(), this);
    }

    update(dt: number) {
        this._bt.update(dt);
    }

    protected abstract onBuild(builder: BTBuilder<this>): void

}